package com.petAdoption.manager.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.petAdoption.manager.entity.Product;
import com.petAdoption.manager.mapper.ProductMapper;
import com.petAdoption.manager.service.IProductService;
import com.petAdoption.manager.vo.ProductVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 王倩茹
 * @since 2023-08-28
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {
    @Resource
    private ProductMapper productMapper;

    @Override
    public List<ProductVO> findAll() {
        return productMapper.findAll();
    }

    @Override
    public List<ProductVO> findByName(String productName) {
        return productMapper.findByName(productName);
    }

    @Override
    public int updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public int delProduct(Integer productId) {
        return productMapper.deleteById(productId);
    }

    @Override
    public int addProduct(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public List<ProductVO> productTypeName(Integer productType) {
        return productMapper.productTypeName(productType);
    }

    @Override
    public List<ProductVO> productTypeById(Integer productTypeId) {
        return productMapper.productTypeById(productTypeId);
    }


}
